package com.vaadin.thomas.contenttool.data;

import java.util.Date;
import java.util.Locale;
import java.util.Map;

public interface Version extends Comparable<Version> {

	// TODO optimize
	public abstract Value getValue(String key);

	public abstract Map<String, Value> getValuesInThis();

	public abstract Map<String, Value> getAllValues();

	public abstract boolean isPreview();

	public abstract Map<String, Object> getVersionProperties();

	public abstract int getVersionNumber();

	public abstract Date getCommitDate();

	public abstract String getCommitterId();

	/**
	 * Get the correct String value to display when running this {@link Version}
	 * of the data. Uses {@link Version} history if needed.
	 * <p>
	 * If the key doesn't match any data in the system, the key itself is
	 * returned.
	 */
	public abstract String get(Model m, String identifier, Locale loc);

	/**
	 * @return if this {@link Version} is the current Production {@link Version}
	 *         , i.e. the most recently committed one.
	 */
	public abstract boolean isProduction();

}